package net.frenopatico.kynes.searchr.services.imp;

import net.frenopatico.kynes.annotation.LazyService;
import net.frenopatico.kynes.searchr.dao.MessageDAO;
import net.frenopatico.kynes.searchr.models.Message;
import net.frenopatico.kynes.searchr.services.MessageService;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;

/**
 * @author Eduardo Ramírez <edu.kynes@gmail.com>
 *
 */
@LazyService
@Transactional
public class MessageServiceImp implements MessageService {

    /**
     *  Message DAO.
     */
    @Autowired
    private MessageDAO messageDao; //NOPMD

    /*
     * (non-Javadoc)
     * 
     * @see net.frenopatico.kynes.searchr.services.MessageService#get( java.lang.Long )
     */
    @Override
    public final Message get( final Long messageId ) {
        return messageDao.get( messageId );
    }
    
    /*
     * (non-Javadoc)
     * 
     * @see net.frenopatico.kynes.searchr.services.MessageService#save( net.frenopatico.kynes.searchr.models.Message )
     */
    @Override
    public final Message save( final Message messageEntity ) {
        return messageDao.save( messageEntity );
    }
}
